package com.chepaandvasia.dao;

import com.chepaandvasia.entities.Car;
import com.chepaandvasia.entities.Customer;
import com.chepaandvasia.entities.ServiceCheck;
import com.chepaandvasia.entities.Status;
import java.util.List;


public interface CarDAO {

    /*
     * This method inserts Car car in the database.
     * While inserting, car is given unique id
     * @param car instance of Car  to be created     
     */
    public void create(Car car);

    /*
     * This method get instance of Car, specified with given id, from database.
     * @param id id of Car to be retrieved
     * @return instance of Car with given id     
     */
    public Car get(Long id);

    /*
     * This method updates state of Car into database
     * @param car instance of Car to be updated in database     * 
     */
    public void update(Car car);

    /*
     * This method removes Car car from database.
     * @param car instance of Car to be removed
     */
    public void remove(Car car);
    
    /*
     * @return active serviceCheck, if Car is in service
     */
    public List<ServiceCheck> getActiveServiceChecks(Car car,boolean active);
    
    /*
     * This method finds all available cars for given customer.
     * @param customer instance of Customer
     * @return list of Cars of given customer
     */
    public List<Car> findAllCarsForCustomer(Customer position);

    /*
     * This method find all cars including cars on service check.
     * @return list of all Cars 
     */
    public List<Car> findAllCars();
        
    /*
     * This methd return all Cars with selected status
     * @param status = Status
     * @return list of all Cars with this status
     */
    public List<Car> getCarsByStatus(Status status);
    
} 